# -*- coding: utf-8 -*-
# @Time    : 2024/2/4 21:10
# @Author  : micah
# @File    : 18.浏览器的信息配置.py
# @Software: PyCharm


import time
from selenium import webdriver


# 创建浏览器配置对象
options = webdriver.ChromeOptions()

# 1.是否禁止图片加载
prefs = {"profile.managed_default_content_settings.images": 2}
options.add_experimental_option('prefs', prefs)

# 2.设置UA
user_agent = 'abc'
options.add_argument(f'user-agent={user_agent}')

browser = webdriver.Chrome(options=options)
browser.get('https://www.taobao.com')


time.sleep(30)
browser.quit()
